package com.jf.cloud.api.order.feign;

import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.order.vo.OrderSelfStationVO;
import com.jf.cloud.common.order.vo.OrderVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "jfcloud-order",contextId = "order-selfstation")
public interface OrderSelfStationFeignClient {

    /**
     * 根据提货码查询订单
     * @param stationId 退款id
     * @param code   自提码
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/selfstation/getOrderByStationCode")
    ServerResponseEntity<OrderVO> getOrderByStationCode(@RequestParam("stationId") Long stationId, @RequestParam("code") String code);

    /**
     * 获取用户常用的自提信息
     * @param userId 用户id
     * @return 用户自提订单信息
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/selfstation/getUserStation")
    ServerResponseEntity<List<OrderSelfStationVO>>  getUserStation(@RequestParam("userId") Long userId);

}
